/**
 * 招聘管理接口
 */
import request from '@/utils/request';

/**
 * 获取渠道发布记录统计
 * @param {*} params
 */
export async function getChannelRecordCount(params) {
    return request('/api/recruitment/v1/outward_channel_records/channelrecordcount', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取简历获取记录统计
 * @param {*} params
 */
export async function getResumeRecordCount(params) {
    return request('/api/recruitment/v1/resume_fetch_records/fetchrecordcount', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取邮箱获取记录统计
 * @param {*} params
 */
export async function getEmailRecordCount(params) {
    return request('/api/recruitment/v1/resume_fetch_records/fetchrecordmailcount', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取渠道发布记录列表
 * @param {*} params
 */
export function getChannelPublishRecords(params) {
    return request('/api/recruitment/v1/channel_releases/recruit_outward_channel_records', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取渠道分组
 */
export async function getChannelTree() {
    return request('/api/recruitment/v1/channel_settings/channelgrouplist', {
        method: 'GET'
    });
}

/**
 * 所有渠道-不隔离-包含人才库
 */
export async function getChannelListWithTalent(params) {
    return request('/api/recruitment/v1/channel_settings/channel_talent_select_list', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取邮件列表
 */
export async function getEmailList(params) {
    return request('/api/recruitment/v1/email_employees/actions/emialemployeelist', {
        method: 'POST',
        data: params
    });
}

/**
 * 获取招聘需求详情
 */
export async function getResumeDetail(recruitCode) {
    return request(`/api/recruitment/v1/detailbycode/${recruitCode}`, {
        method: 'GET'
    });
}

/**
 * 获取外部渠道需求详情
 */
export async function getOuterResumeDetail(recordId) {
    return request(`/api/recruitment/v1/channel_releases/recruit_channel_records/${recordId}`, {
        method: 'GET'
    });
}

/**
 * 简历获取记录列表
 * @param {*} params
 */
export async function getResumeRecords(params) {
    return request('/api/recruitment/v1/resume_fetch_records/fetch_records', {
        method: 'POST',
        data: params
    });
}

/**
 * 渠道设置操作记录列表
 * @param {*} params
 */
export async function getChannelOperateList(params) {
    return request('/api/recruitment/v1/channel_settings/channel_operate_records/actions/search', {
        method: 'POST',
        data: params
    });
}

/**
 * 校验招聘需求是否有变更
 */
export async function getRecruitmentUpdated(outwardId) {
    return request(`/api/recruitment/v1/channel_releases/${outwardId}/actions/check_recruit_change`, {
        method: 'GET'
    });
}

/**
 * 处理招聘需求变更信息
 * @param {*} params
 */
export async function queryRecruitmentUpdate(params) {
    return request('/api/recruitment/v1/channel_releases/actions/deal_recruit_change', {
        method: 'POST',
        data: params
    });
}
